package com.taffywen.study.spring_cloud_learn.controller;


import com.taffywen.study.spring_cloud_learn.api.SpringStudyApi;
import lombok.extern.slf4j.Slf4j;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.client.RestTemplate;

@RestController
@Slf4j
public class CallController {

//    private static final Logger log = LoggerFactory.getLogger(CallController.class);
    @Autowired
    private RestTemplate restTemplate;

    @Autowired
    private SpringStudyApi springStudyApi;
    @RequestMapping("/call")
    public String call() {
        log.info("call-------------");
//        return restTemplate.getForObject("http://localhost:8081/getDemoNacos", String.class);
        return springStudyApi.getName();
    }
}
